<!DOCTYPE html>
<html>
<head>
<title></title>
    #parse("sys/header.html")
</head>
<!--<body   onload="setCodeValue()"   >-->
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
        <div id="queryDiv" class="queryDiv">
            <div class="grid-btn">
                <div class="form-group col-sm-2 keyword">
                    <input type="text" class="form-control" id="keyword" @keyup.enter="query"
                           placeholder="公司名称模糊查询">
                </div>
                <a class="btn btn-primary" @click="query">查询</a>

				#if($shiro.hasPermission("zwan/companyinfo:save"))
				<a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
				#end
				#if($shiro.hasPermission("zwan/companyinfo:update"))
				<a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
				#end
				#if($shiro.hasPermission("zwan/companyinfo:delete"))
				<a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
				#end
				#if($shiro.hasPermission("zwan/companyinfo:save"))
				<a class="btn btn-primary" @click="bind"><i class="fa fa-eye"></i>&nbsp;查看已绑定设备</a>
				#end

			</div>
		</div>
	    <table id="jqGrid"></table>
	    <div id="jqGridPager"></div>
    </div>
    
    <div v-show="!showList" class="panel panel-default">
		<div class="panel-heading" style="display: block">{{title}}</div>
		<form class="form-horizontal">
			<div class="form-group">
			   	<div class="col-sm-2 control-label">企业名称</div>
			   	<div class="col-sm-10">
			        <input type="text" class="form-control" v-model="companyinfo.companyname" placeholder=""/>
			    </div>
			</div>
			<div class="form-group">
			   	<div class="col-sm-2 control-label">企业联系人</div>
			   	<div class="col-sm-10">
			        <input type="text" class="form-control" v-model="companyinfo.companyaccount" placeholder=""/>
			    </div>
			</div>

			<div class="form-group">
			   	<div class="col-sm-2 control-label">联系人电话</div>
			   	<div class="col-sm-10">
			        <input type="text" class="form-control" v-model="companyinfo.phoneno" placeholder=""/>
			    </div>
			</div>

			<div class="form-group">
			   	<div class="col-sm-2 control-label">E-Mail地址</div>
			   	<div class="col-sm-10">
			        <input type="text" class="form-control" v-model="companyinfo.email" placeholder=""/>
			    </div>
			</div>

			<div class="form-group">
				<div class="col-sm-2 control-label"></div> 
				<input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
				&nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
			</div>
		</form>
	</div>
	<!-- 模态框（Modal） -->
	<div v-show="bindmodal"  class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog" style="width: 1000px;height: 600px">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
					<h4 class="modal-title" id="myModalLabel">已绑定设备</h4>
				</div>
				<div class="modal-body">
					<div id="querybindDiv" class="queryDiv">
						<div class="grid-btn">
							<div class="form-group col-sm-2 keyword">
								<input type="text" class="form-control" id="keywordbind" @keyup.enter="querybinddevice"
									   placeholder="设备编号/批次号">
							</div>
							<a class="btn btn-primary" @click="querybinddevice">查询</a>


						</div>
					</div>

					<!-- Table -->
					<table id="jqGridBind"></table>
					<div  id="jqGridPagerBind"></div>

				</div>
				<div class="modal-footer">
<!--
					<button type="button" class="btn btn-primary" @click="addbind"><i class="fa fa-plus-circle"></i>&nbsp;添加设备</button>
-->
					<button type="button" class="btn btn-primary" @click="delbind"><i class="fa fa-trash-o"></i>&nbsp;删除设备</button>
					<button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-undo"></i>&nbsp;返回</button>

				</div>
			</div><!-- /.modal-content -->
		</div><!-- /.modal-dialog -->
	</div>



	<!-- 模态框（Modal） -->
	<div v-show="addBindmodal"  class="modal fade" id="addBindmodal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog" style="width: 1000px;height: 600px">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
					<h4 class="modal-title" >添加绑定设备</h4>
				</div>
				<div class="modal-body">
					<!-- Table -->
					<table style="margin: auto" id="jqGridAddBind"></table>

				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-primary" @click="activeDevice"><i class="fa fa-plus-circle"></i>&nbsp;确定</button>
					<button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-undo"></i>&nbsp;返回</button>

				</div>
			</div><!-- /.modal-content -->
		</div><!-- /.modal-dialog -->
	</div>
</div>

<script src="${rc.contextPath}/js/zwan/companyinfo/companyinfo.js?_${date.systemTime}"></script>
</body>
</html>